package com.bsoft.exchange.dao.his;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import com.bsoft.exchange.domain.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 创建日期 : 2019/6/12
 * 创建人 : 赵太行
 */
@Mapper
public interface PaymentMapper {
    /**
     * 获取医生信息列表（只有处方的信息）
     * @param mzlx 门诊类型
     * @param jgid
     * @param kssj 开始时间
     * @param jssj 结束时间
     * @param brid 病人Id
     * @return
     */
    ArrayList<UnPayedListDomain> getMedicalList(@Param("MZLX")String mzlx,@Param("JGID")String jgid,@Param("KSSJ")String kssj, @Param("JSSJ")String jssj, @Param("list")List<String> brid,@Param("cfsb") List<Long> cfsb) throws SQLException;

    /**
     * 不包含医技
     * @param mzlx
     * @param jgid
     * @param kssj
     * @param jssj
     * @param brid
     * @param cfsb
     * @return
     */
    UnPayedListDomain getMedicalListExt(@Param("MZLX")String mzlx,@Param("JGID")String jgid,@Param("KSSJ")String kssj, @Param("JSSJ")String jssj, @Param("list")List<String> brid,@Param("cfsb") List<Long> cfsb) throws SQLException;
    /**
     *获取待支付医技信息
     */
//    ArrayList<UnPayedListDomain>getYJXX(@Param("MZLX")Integer mzlx,@Param("JGID")String jgid,@Param("KSSJ")String kssj, @Param("JSSJ")String jssj,@Param("list")List<String> brid)throws SQLException;;

    /**
     * 获取已支付列表接口
     * @param zxbz 执行标志：0本参数无效 1已执行 2未执行 3 已退费 4 已作废
     * @param mzlx
     * @param jgid
     * @param kssj
     * @param jssj
     * @param brid
     * @return
     * @throws SQLException
     */
    List<PaymentDomain>getPayList(@Param("ZXBZ")Integer zxbz,@Param("MZLX")String mzlx,@Param("JGID")String jgid,@Param("KSSJ")String kssj, @Param("JSSJ")String jssj, @Param("list")List<String> brid)throws SQLException;

    public List<FeeAllDomain> getFeeDetail(@Param("jgid")Long jgid,@Param("brid")Long brid,@Param("fphm")String fphm);

    /**
           * 根据病人标识获取费用预结算信息
     * @param hospitalCode
     * @return
     * @throws SQLException
     */
    List<GetPrecalculatedFeeData> getPrecalculatedFee(@Param("jgid")String hospitalCode,@Param("cfsbList")List<String> cfsbList,@Param("yjxhList")List<String> yjxhList);
    List<GetPrecalculatedFeeCheckData> getPrecalculatedFeeCheckData(@Param("jgid")String hospitalCode,@Param("cfsbList")List<String> cfsbList,@Param("yjxhList")List<String> yjxhList);
    
    List<NotifyPayedData> getNotifyPayedData(@Param("jgid")String hospitalCode,@Param("cfsbList")List<String> cfsbList,@Param("yjxhList")List<String> yjxhList);
    
    public void saveSFMX(MS_SFMXDomain sfmx);
    public void saveMZXX(MS_MZXXDomain mzxx);
    
    public void saveFKXX(MS_FKXXDomain fkxx);
    
    public void updateCF(@Param("fphm")Long fphm ,@Param("mzxh")Long mzxh ,@Param("jgid")Long jgid ,@Param("cfsbList")List<String> cfsbList);

    public void updateCFExt(@Param("fphm")Long fphm ,@Param("mzxh")Long mzxh ,@Param("jgid")Long jgid ,@Param("cfsbList")List<String> cfsbList,@Param("address") String address);

    public void updateYJ(@Param("fphm")Long fphm ,@Param("mzxh")Long mzxh ,@Param("jgid")Long jgid ,@Param("cfsbList")List<String> cfsbList,@Param("yjxhList")List<String> yjxhList);
    
    public Long getQtysFkfs(@Param("jgid")Long jgid,@Param("fklb")Long fklb,@Param("brxz")Long brxz,@Param("sylx")Long sylx);
    
    public Long getJzxhCF(@Param("cfsb")Long cfsb);
    
    public Long getJzxhYJ(@Param("yjxh")Long yjxh);

    List<BrdaInfo>getMzhmList(@Param("list")List<String> brid);

}
